package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.firepreventionplan;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.firepreventionplan.FirepreventionplanService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防预案控制器
 */
@Action
@RequestMapping(value="business/firepreventionplan")
public class FirepreventionplanController extends BaseController {
    @Resource
    public FirepreventionplanService firepreventionplanService;

    /**
     * 消防预案列表
     * @param
     * page	第几页
     * limit	每页多少条
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * createyear	创建年份
     * @return
     */
    @At(value = "firepreventionplanListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity firepreventionplanListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firepreventionplanService.firepreventionplanListPage(jsonParam);
    }

    /**
     * 消防预案详情
     * @param  id	消防预案的id
     * @return
     */
    @At(value = "firepreventionplanDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity firepreventionplanDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return firepreventionplanService.firepreventionplanDetail(jsonParam);
    }

    /**
     * 消防预案新增
     * @param
     * briefly	简要
     * name	名称
     * fileName	附件名称
     * filePath	附件路径
     * @return
     */
    @At(value = "firepreventionplanAdd", method = RequestMethod.POST)
    public RespEntity firepreventionplanAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return firepreventionplanService.firepreventionplanAdd(jsonParam);
    }

    /**
     * 消防预案修改
     * @param
     * briefly	简要
     * name	名称
     * fileName	附件名称
     * id	消防预案id
     * filePath	附件路径
     * @return
     */
    @At(value = "firepreventionplanUpdate", method = RequestMethod.POST, param = { "id" })
    public RespEntity firepreventionplanUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firepreventionplanService.firepreventionplanUpdate(jsonParam);
    }

    /**
     * 消防预案删除
     * @param   id	消防预案的id
     * @return
     */
    @At(value = "firepreventionplanDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity firepreventionplanDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return firepreventionplanService.firepreventionplanDelete(jsonParam);
    }






   
}